<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/validate.jsp"%>
<%
  // 注销推送
	DeviceToken deviceToken = DeviceToken.fromMap(parameters, DeviceToken.class);
  List<DeviceToken> dList = QBuilder.db("basedb").select().from("DeviceToken").where(new Where("hospital=", deviceToken.getHospital()).and("token=", deviceToken.getToken()).and("uid=", deviceToken.getUid()).and("status=", STATUS_ENABLE).and("client=", deviceToken.getClient())).page(1,1).query().getResultObj();
	if (dList.size() > 0) {
    for (int i = 0; i < dList.size(); i++) {
      DeviceToken dt = dList.get(i);
      dt.setStatus(STATUS_DISABLE);
    }
    DBTools.db("basedb").modItem(dList);
  }
	Tools.encryptPrint(out, new Message());
%>
